package com.example.springboottestgit.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * @description:
 * @author: ZZZ
 */

public enum SeparatorEnum {

    S1("#####", "#####", "*****", "\\*\\*\\*\\*\\*"),
    S2("*****", "\\*\\*\\*\\*\\*", "$$$$$", "\\$\\$\\$\\$\\$"),
    S3("$$$$$", "\\$\\$\\$\\$\\$", "&&&&&", "&&&&&"),
    S4("&&&&&", "&&&&&", "", "");

    //当前分隔符
    private String separator;
    private String nowSplit;

    //下一层当前分隔符
    private String nexSeparator;
    private String nextSplit;


    private static Map<String, SeparatorEnum> map = new HashMap<>();

    static {
        for (SeparatorEnum returnEnum : SeparatorEnum.values()) {
            map.put(returnEnum.separator, returnEnum);
        }
    }


    public static Map<String, SeparatorEnum> getMap() {
        return map;
    }

    public static SeparatorEnum getSeparatorEnum(String separator) {
        return map.get(separator);
    }


    SeparatorEnum(String separator, String nowSplit, String nexSeparator, String nextSplit) {
        this.separator = separator;
        this.nowSplit = nowSplit;
        this.nexSeparator = nexSeparator;
        this.nextSplit = nextSplit;
    }

    public String getSeparator() {
        return separator;
    }

    public String getNowSplit() {
        return nowSplit;
    }

    public String getNexSeparator() {
        return nexSeparator;
    }

    public String getNextSplit() {
        return nextSplit;
    }
}


